package top.hhydra.mimall.controller;


import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import top.hhydra.mimall.service.ICategoryService;
import top.hhydra.mimall.vo.CategoryVo;
import top.hhydra.mimall.vo.ResponseVo;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author SaiyaEmon
 * @since 2020-02-11
 */
@RestController
@Api(value="分类controller",tags={"分类操作接口"})
@Slf4j
public class CategoryController {

    @Autowired
    private ICategoryService categoryService;

    @GetMapping("/categories")
    @ApiOperation(value = "查询所有分类")
    public ResponseVo<List<CategoryVo>> categories(){
        log.info("查询所有分类");
        return categoryService.categories();
    }
}
